<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>加盟商地址</title>
    <link rel="stylesheet" type="text/css" th:href="@{/manager/easyui/themes/default/easyui.css}">
    <link rel="stylesheet" type="text/css" th:href="@{/manager/easyui/themes/icon.css}">
    <script type="text/javascript" th:src="@{/manager/easyui/jquery.min.js}"></script>
    <script type="text/javascript" th:src="@{/manager/easyui/jquery.easyui.min.js}"></script>
    <script type="text/javascript" src="https://api.map.baidu.com/api?v=1.0&type=webgl&ak=69CfVIuq4JbamVcd3RSJmHErqE3L2pb6"></script>
    <style type="text/css">
        html, body, #container{
            height: 100%;
            margin: 0;
            padding: 0;
            width: 100%;
        }
    </style>
</head>

<body>
<div style="display: none" id="gps" th:text="${ gps }"></div>
<div id="container"></div>
</body>
<script>
    var gps = $("#gps").text();
    var coords = gps.split(','); // 假设gps是形如"116.404,39.915"的字符串
    var point = new BMapGL.Point(parseFloat(coords[0]), parseFloat(coords[1]));
    var map = new BMapGL.Map("container");
    map.centerAndZoom(point, 15);
    var content = parseFloat(coords[0])+","+parseFloat(coords[1]);
    var label = new BMapGL.Label(content, {
        position: point,
        offset: new BMapGL.Size(0, -20)
    });
    map.addOverlay(label);
</script>
</html>